package com.alibaba.citrus.cr.b2b.trade.order.repository;

import com.alibaba.cz.base.tool.page.PageResult;
import com.alibaba.lattice2.epoch.sdk.model.Result;
import com.epoch.app.crb2btradecenter.domain.order.dto.QueryByOrderBizIdsRequest;
import com.epoch.app.crb2btradecenter.dto.request.OrderPageQueryRequest;
import com.epoch.app.crb2btradecenter.dto.request.OrderQueryRequest;
import com.epoch.app.crb2btradecenter.dto.response.OrderPageQueryResponse;
import com.epoch.app.crb2btradecenter.dto.response.OrderQueryResponse;
import com.epoch.app.crb2btradecenter.model.dto.PageQueryOrderEsListRequest;
import com.epoch.app.crb2btradecenter.sdo.OrderSDO;

import java.util.List;

/**
 * @author 张苏徽
 * @date 2021/9/9
 */
public interface OrderQueryServiceRepository {

    /**
     * 分页查询销售订单列表
     *
     * @param request OrderPageQueryRequest
     * @return
     */
    PageResult<List<OrderPageQueryResponse>> pageQuery(OrderPageQueryRequest request);

    /**
     * 查询销售订单详情
     *
     * @param request OrderQueryRequest
     * @return OrderSDO
     */
    OrderQueryResponse query(OrderQueryRequest request);

    OrderSDO querySingle(OrderQueryRequest request);

    /**
     * 根据内部业务单号查询销售订单详情
     *
     * @param request QueryByOrderBizIdsRequest
     * @param needLines boolean
     * @return OrderSDO
     */
    List<OrderSDO> queryByOrderBizIds(QueryByOrderBizIdsRequest request, boolean needLines);

    /**
     * 根据外部业务单号查询销售订单详情
     *
     * @param outerOrderId String
     * @return OrderSDO
     */
    OrderSDO queryByOuterOrderId(String outerOrderId);

    Result<List<OrderPageQueryResponse>> pageQueryES(PageQueryOrderEsListRequest request);

}
